<!-- 左侧菜单 -->
<template>
<el-aside id="baseAside" class="flex flex-v">
  <el-menu 
    class="el-menu-vertical-demo" 
    :collapse="isCollapse"
    :default-active="$route.path"
    router
    background-color="#f7f8f9"
    text-color="#747475"
    active-text-color="#eb5555">
    <el-menu-item
      v-for="(item, index) in menuOptions" 
      :key="index" 
      :index="item.path">
      <i :class="item.icon"></i>
      <span slot="title">{{item.text}}</span>
    </el-menu-item>
  </el-menu>
</el-aside>
</template>

<script>
export default {
  name: 'BaseAside',
  data () {
    return {
      menuOptions: [
        {
          icon: 'el-icon-orange',
          text: '词典',
          path: '/'
        },
        {
          icon: 'el-icon-star-off',
          text: '翻译',
          path: '/interpret'
        },
        {
          icon: 'el-icon-notebook-2',
          text: '单词本',
          path: '/wordBook'
        },
        {
          icon: 'el-icon-document',
          text: '文档翻译',
          path: '/docInterpret'
        }
      ],
      isCollapse: false
    }
  },
  methods: {
  }
}
</script>

<style rel="stylesheet/scss" lang="scss">
@import '@/styles/variable.scss';
#baseAside{
  width: 160px !important;
  height: 100vh;
  background-color: $f7Gray;
  color: $f4Gray;
  font-size: $font15;
  padding-top: 40px;
  .el-menu-item {
    -webkit-app-region: no-drag;
  }
  .el-menu-item:focus, .el-menu-item:hover {
    background-color: $f7Gray !important;
    color: $baseColor !important;
    i {
      color: $baseColor !important;
    }
  }
  .el-menu-item.is-active {
    background-color: $pinkColor !important;
    color: $baseColor !important;
  }
  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 100%;
    min-height: 400px;
  }
}
</style>